Skip to content

Upgrade toolchain and move to Python 3.14 - #27

Merged
amrtgaber merged 1 commit into
mainfrom
python-314-toolchain-refresh
Jul 28, 2026
Merged

Upgrade toolchain and move to Python 3.14#27
amrtgaber merged 1 commit into
mainfrom
python-314-toolchain-refresh

Conversation

@amrtgaber

Copy link
Copy Markdown
Contributor

Applies the api-template refresh. This service was furthest behind (fastapi floor 0.115, locked 0.128).

  • ruff pre-commit hook v0.8.6 → v0.16.0 (ruff-check id) + autofixes
  • uv lock --upgrade: FastAPI 0.128 → 0.140.7, Starlette 1.3.1, OTel 1.44/0.65b0, structlog 26, wrapt 2
  • Python 3.14 everywhere (.python-version, requires-python, ruff target, Docker base); 122/122 tests green on 3.14.4
  • CI: checkout@v7, setup-uv pinned v9.0.0; GCP deploy actions already current
  • Dockerfile uv stage pinned; weekly grouped Dependabot added

Why no fastapi<0.136 hold here (unlike vagrant-story-api #86): rate limiting is an in-house http middleware calling limits directly — slowapi's broken SlowAPIMiddleware/default_limits path isn't used, and the full suite (including auth rate-limit coverage) passes on FastAPI 0.140.7 + Starlette 1.3.1.

Two observations for follow-up, not changed here: slowapi is now only used for its Limiter wrapper + 429 handler (could be replaced by limits alone), and non-auth routes have no rate limiting at all — worth a deliberate decision given the public API audience.

Deliberately not bumped: dev compose Postgres 16 (coordinate with production separately). Deploy note: Docker base 3.14 ships on next Cloud Run deploy.

Test note: the suite requires an AWS profile (ag-tech-admin); verified with an isolated config, all 122 green.

Refresh the lockfile across the board (FastAPI 0.128 -> 0.140.7,
Starlette 1.3, OpenTelemetry 1.44/0.65b0, structlog 26, wrapt 2), update
the ruff pre-commit hook from v0.8.6 to v0.16.0 with the ruff-check id
and apply its fixes, and move to Python 3.14 across .python-version,
requires-python, ruff target-version, and the Docker base image. Pin the
Dockerfile uv stage, bump CI to checkout@v7 and setup-uv@v9.0.0, and add
weekly grouped Dependabot updates.

Unlike sibling services no FastAPI hold is needed: rate limiting here is
an in-house http middleware calling limits directly, not slowapi's
SlowAPIMiddleware default_limits path that FastAPI >=0.137 breaks, and
the full suite passes on the new stack. The dev compose Postgres stays
on 16 pending a coordinated production upgrade.
@amrtgaber
amrtgaber merged commit 081bf1a into main Jul 28, 2026
1 of 2 checks passed
@amrtgaber
amrtgaber deleted the python-314-toolchain-refresh branch July 28, 2026 03:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant